local wu__fengxing = fk.CreateSkill {
  name = "wu__fengxing",
}

Fk:loadTranslationTable{
  ["wu__fengxing"] = "风行", 
  [":wu__fengxing"] = "准备阶段，你可以视为使用一张冰【杀】。若如此做，你跳过出牌阶段和弃牌阶段。", 
  ["#wu__fengxing-choose"] = "风行：你可以视为使用一张冰【杀】，然后跳过出牌阶段和弃牌阶段", 
}

wu__fengxing:addEffect(fk.EventPhaseStart, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(wu__fengxing.name) and player.phase == Player.Start and
      table.find(player.room:getOtherPlayers(player, false), function (p)
        return player:canUseTo(Fk:cloneCard("ice__slash"), p, {bypass_times = true})
      end)
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    local ice__slash = Fk:cloneCard("ice__slash")
    local max_num = ice__slash.skill:getMaxTargetNum(player, ice__slash)
    local targets = table.filter(room:getOtherPlayers(player, false), function (p)
      return player:canUseTo(ice__slash, p, {bypass_times = true})
    end)
    local tos = room:askToChoosePlayers(player, {
      min_num = 1,
      max_num = max_num,
      targets = targets,
      skill_name = wu__fengxing.name,
      prompt = "#wu__fengxing-choose",
      cancelable = true,
    })
    if #tos > 0 then
      event:setCostData(self, {tos = tos})
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local targets = event:getCostData(self).tos
    room:sortByAction(targets)
    room:useVirtualCard("ice__slash", nil, player, targets, wu__fengxing.name, true)
    player:skip(Player.Play)
    player:skip(Player.Discard)
  end,
})

return wu__fengxing